#include "thread_pool.hpp"
#include "task.hpp"
#include<time.h>
#include<unistd.h>
#include<string>

int main()
{
	srand((unsigned int)time(nullptr));
	ThreadPool<Task>* tp = ThreadPool<Task>::get_instance();
	tp->InitThreadPool(5);

	const std::string  ops = "+-*/";
	while(1)
	{
		int x = rand()%20 + 1;
		int y = rand()%20 + 1;
		char op = ops[rand()%4];

		Task t(x,y,op);
		tp->PushTask(t);
		sleep(1);
	}
	return 0;
}
